{% extends "base.html" %}
{% block title %}issues{% endblock %}
{% block head %}
<style type="text/css">

</style>
{% endblock %}
{% block content %}


<div class="align-middle col-12 row">
  <h5 class="h2 d-inline">
    <span class="text-muted ">Edit issue: <strong class="text-info">"{{ issue['title'] }}"</strong></span>
</div>
<hr class="border-bottom border-info" />
<form method="post">
  <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />



  <div class="form-group row">
    <label for="categorys" class="col-sm-2 col-form-label col-form-label-md">标题</label>
    <div class="col-sm-4">
      <input name="title" id="title" class="form-control form-control-md"
        value="{{ request.form['title'] or issue['title'] }}" required>
    </div>
    <small id="emailHelp" class="form-text text-muted">请输入标题</small>
  </div>
  <div class="form-group row">
    <label for="categorys" class="col-sm-2 col-form-label col-form-label-md">categorys</label>
    <div class="col-sm-4">
      <select class="form-control form-control-md " name='category_name' id="category_name">
        {% if categorys  %}
        {% for category in categorys %}
        <option>{{category.name}}</option>
        {% endfor %}
        {% else %}
        <option>没有主题，请先创建</option>
        {% endif %}
      </select>
    </div>
    <small id="emailHelp" class="form-text text-muted">请选择主题</small>
  </div>

  <div class="form-group row">
    <label for="body" class="col-sm-2 col-form-label col-form-label-md">问题</label>
    <div class="col-sm-4">
      <textarea name="body" class="form-control form-control-md" rows='10'
        id="body">{{ request.form['body'] or issue['body'] }}</textarea>
    </div>
    <small id="emailHelp" class="form-text text-muted">请输入问题描述</small>
  </div>

  <div class="form-group row">
    <div class="col-sm-4  offset-2">
      <button type="submit" class="btn btn-primary  btn-block btn-md">save</button>
    </div>
  </div>
</form>



{% endblock %}